<?php


namespace app\erp\model;


use think\Model;

class Pikuanxinxidb extends Model
{
    protected $pk = 'pkxx_id';
    protected $name = 'pikuanxinxi';
    protected $autoWriteTimestamp = true;

    public $param = [];

    public function base($query)
    {
        if(isset($this->param['fkdw']) && $this->param['fkdw']){
            $query->whereLike('fkdw','%'.$this->param['fkdw'].'%');
        }
        if(isset($this->param['address']) && $this->param['address']){
            $query->whereLike('address','%'.$this->param['address'].'%');
        }
        if(isset($this->param['phone']) && $this->param['phone']){
            $query->whereLike('phone','%'.$this->param['phone'].'%');
        }
        if(isset($this->param['xxp']) && $this->param['xxp']){
            $query->whereLike('xxp','%'.$this->param['xxp'].'%');
        }
    }
}